package com.higgins.eventtracking.client.finance;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Logger;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockLayoutPanel.Direction;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.higgins.eventtracking.client.AssetTrackingService;
import com.higgins.eventtracking.client.AssetTrackingServiceAsync;
import com.higgins.eventtracking.client.FinanceTrackingService;
import com.higgins.eventtracking.client.FinanceTrackingServiceAsync;
import com.higgins.eventtracking.client.SecurityAccessDeniedException;
import com.higgins.eventtracking.client.dto.AssetDTO;
import com.higgins.eventtracking.client.dto.TransactionDTO;
import com.higgins.eventtracking.server.GenericDataStoreService;

public class OutstandingTransactionsTab extends VerticalPanel		{
	private static final Logger log = Logger.getLogger(OutstandingTransactionsTab.class.getName());
	private boolean firstRun = true;
	private OutstandingTransactionsTable outstandingTransactionsTableHandle;
		
	public void update()	{
		if (firstRun)
			initialise();
//		else
//			refresh();
	}

//	public void refresh()	{
//		outstandingTransactionsTableHandle.refresh();
//	}
	public void initialise()	{
//		firstRun = false;
		clear();
		final OutstandingTransactionsColumns outstandingTransactionsColumns = new OutstandingTransactionsColumns();
		final OutstandingTransactionsTable outstandingTransactionsTable = new OutstandingTransactionsTable(outstandingTransactionsColumns);
		outstandingTransactionsTableHandle = outstandingTransactionsTable;
		ScrollPanel scrollPanel = new ScrollPanel();
		scrollPanel.add(outstandingTransactionsTable);
		scrollPanel.setHeight("600px");
		add(scrollPanel);
	}
}
